<?php
require 'db_config.php';
$user=$_POST['user'];
$user=str_replace(' ','',$user);//删除空格
$pwd=$_POST['pwd'];
$pwd=password_hash($pwd,PASSWORD_BCRYPT);//密码加密处理
$reg_date=date("Y-m-d H:m:i");
$sql="insert into users (user,pwd,reg_date) VALUES ('$user','$pwd','$reg_date')";
$res=mysqli_query($con,$sql);
if (mysqli_affected_rows($con)>0){
    echo '注册成功！';
}else{
    echo '注册失败！数据库错误'.$sql;
}
